<?php 
//用户身份验证
include "config.php";
$user = $_POST["user"];
$password = $_POST["password"];
$sql = "SELECT * FROM $user_table where user_name='$user' and user_pass='$password'";
//$query=mysql_query("select * from $user_table where user_name='$user' and user_pass='$password'");
$query=mysql_query($sql);

$num=mysql_num_rows($query);
if ($num == -1)
{
   include "header.php";
   echo "请你确认用户名和密码是否正确?<br><br>";
   echo "<a href=index.php>重新填写</a><br><br>";
   echo "<a href=register.php>用户注册</a><br><br>";
}
else
{
    setcookie("cookie_pass", "$password", time()+10000, "/");
    setcookie("cookie_user","$user",time()+10000,"/");
	include "header.php";
    echo $user ;
	echo "你好 恭喜你<br><br>";
	//echo("<HTML><META http-equiv=\"refresh\" content =\"0;url=book_list.php\"></HTML>");

}
include "foot.php";
?>